﻿/**********************************************************************
 * @file   FITKAcousticsDiscNodeList.h
 * @brief  离散模型节点数据声明
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2024-12-12
 *********************************************************************/
#ifndef _FITK_ACOUSTICS_DISC_NODE_LIST__H___
#define _FITK_ACOUSTICS_DISC_NODE_LIST__H___
 
#include "FITKAcousticsModelAPI.h"
#include "FITK_Kernel/FITKCore/FITKVec3D.h"
#include "FITK_Interface/FITKInterfaceModel/FITKNodeList.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataObject.h"

namespace Acoustics
{
    /**
     * @brief 节点类型，从某种模型拷贝或者产生
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-22
     */
    class  DiscNodeSourceType : public QObject
    {
        Q_OBJECT
    public:
        /**
         * @brief  节点源的位置
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        enum DiscNodeSource
        {
            None,    ///< 空
            SEA,     ///< SEA自己创建
            Geom,    ///< 几何点
            FEM,     ///< FE网格点
        };
        Q_ENUM(DiscNodeSource);

    };
    
    /**
     * @brief ；离散模型节点声明
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-22
     */
    class FITKAcousticsModelAPI  DiscNode :public Core::FITKNode
    {
   
    public:
        using Core::FITKNode::FITKNode;
        /**
         * @brief Construct a new DiscNode object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        explicit DiscNode() = default;
        /**
         * @brief Destroy the DiscNode object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        virtual ~DiscNode() = default;
        /**
         * @brief 设置节点来源类型
         * @param[i]  s              来源类型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        void setNodeSource(DiscNodeSourceType::DiscNodeSource s);
        /**
         * @brief 获取节点来源类型
         * @return DiscNodeSourceType::DiscNodeSource 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        DiscNodeSourceType::DiscNodeSource getNodeSource();
        /**
         * @brief 设置节点来源对象ID
         * @param[i]  id             来源对象ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        void setSourceID(const int& id);
        /**
         * @brief 获取节点来源对象ID
         * @return int 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         *  */
        int getSourceID();
        /**
         * @brief 设置对应的节点ID
         * @param[i]  id             节点ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        void setSourceNodeID(const int& id);
        /**
         * @brief 获取对应的节点ID
         * @return int 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
          */
        int getSourceNodeID();

    private:
        /**
         * @brief 节点来源类型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        DiscNodeSourceType::DiscNodeSource _source{ DiscNodeSourceType::None };
        /**
         * @brief 来源对象ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        int _sourceID{ -1 };
        /**
         * @brief 来源节点ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        int _sourceNodeID{ -1 };
    };
    /**
     * @brief 离散模型节点列表
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-22
     */
    class FITKAcousticsModelAPI FITKAcousticsDiscNodeList : 
        public Interface::FITKNodeList,public Core::FITKAbstractDataObject
    {
        FITKCLASS(Acoustics, FITKAcousticsDiscNodeList);
    public:
        /**
         * @brief Construct a new FITKAcousticsDiscNodeList object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        explicit FITKAcousticsDiscNodeList() = default;
        /**
         * @brief Destroy the FITKAcousticsDiscNodeList object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-22
         */
        virtual ~FITKAcousticsDiscNodeList() = default;
        /**
        * @brief 获取全部节点ID
        * param[o] idList 节点ID
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-10-30
        */
        void getAllNodeID(QList<int> & idlist);
        /**
        * @brief 追加节点,默认是SEA自己创建的
        * @param[i]  x              x坐标
        * @param[i]  y              y坐标
        * @param[i]  z              z坐标
        * @return int     节点ID
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-02-28
        */
        virtual int addNode(const double x, const double y, const double z) override;

        /**
         * @brief 追加节点,默认是SEA自己创建的
         * @param[i]  id             节点ID
         * @param[i]  x              x坐标
         * @param[i]  y              y坐标
         * @param[i]  z              z坐标
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-02-28
         */
        virtual void addNode(const int id, const double x, const double y, const double z) override;
        /**
        * @brief 追加节点
        * @param[i]  x              x坐标
        * @param[i]  y              y坐标
        * @param[i]  z              z坐标
        * @return DiscNode     节点对象
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-02-28
        */
        DiscNode* addDiscNode(const double x, const double y, const double z);

        
    };
}


#endif
